/*
 This solution is linear time.
*/
